#ifndef Process_h
#define Process_h

#include <iostream>
#include <string>
#include <climits>
#include <map>
#include <list>

using namespace std;

class Process {
	public:
		// --------------------
		// Read-Only Properties 
		// --------------------
		string name; // Used to aggregrate results for processes of the same type
		unsigned long id; // Unique ID for each process
		unsigned long issueTime; // The cycle when the process is issued
		unsigned long executionTime; // The total number of cycles the process must execute
		unsigned long blockPeriod; // # of useful cycles between blocking, for example: if this equals 2, the process has 2 productive cycles and then blocks for 'blockTime' cycles. No blocking occurs if this is 0.
		unsigned long blockTime; // The number of cycles the process blocks for every time it blocks
		unsigned long priority; // The static priority of the process (higher number is higher priority)
		unsigned long deadline; // Deadline of 0 in the task scripts means no deadline, it gets changed to UINT_MAX
		
		// ---------------------
		// Modifiable Properties
		// ---------------------

		// Variables for blocking:
		unsigned long productiveCount; // Used to determine when to block
		unsigned long blockStartCycle; // Cycle it started blocking
		bool bllBlocking; // Whether or not is is blocking

		// Persistant until process is finished:
		unsigned long timeTotalProductive; // Only includes productive, non-blocking cycles
		unsigned long timeQueued; // Time waiting to be run (total time it is not active after it has been issued)
		unsigned long inactiveStart; // Timer used to calculate timeQueued
		unsigned long timeTurnaround; // Cycle it finished on - issueTime

		// Non-persistant (only used to count cycles allotted by scheduler):
		unsigned long timeAllotted; // # of cycles that this should remain active 
		unsigned long timeUsed; // # of cycles this has been active (both productive and blocking included). If this is 0, the process runs until it is finished. 
};

#endif
